package com.osig.market.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.osig.common.persistence.Page;
import com.osig.common.web.BaseController;
import com.osig.ec.entity.MaProduct;
import com.osig.ec.service.MaProductService;

@Controller
@RequestMapping(value = "market/product")
public class MaProductController extends BaseController{
	
	@Autowired
	private MaProductService productService;
	
	@ResponseBody
	@RequestMapping(value = "list")
	public Page<MaProduct> findList(HttpServletRequest request, HttpServletResponse response, MaProduct product){
		Page<MaProduct> page = productService.findList(new Page<MaProduct>(request,response), product);
		return page;
	}
	@ResponseBody
	@RequestMapping(value = "save")
	public int save(HttpServletRequest request, HttpServletResponse response, MaProduct product){
		return productService.insert(product);
	}
}
